package com.jay.lang.management.intf;

import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryManagerMXBean;
import java.util.List;

public class MemoryManagerMXBeanIntf {
	public static void main(String[] args) throws IOException {
		List<MemoryManagerMXBean> mxbeans = ManagementFactory
				.getMemoryManagerMXBeans();
		for (MemoryManagerMXBean mbean : mxbeans) {
			System.out.println("----------------");
			System.out.println(mbean.getName());
			System.out.println(mbean.toString());
			System.out.println(mbean.getClass());
			System.out.println(mbean.getObjectName());
			System.out.println(mbean.isValid());
			String[] names = mbean.getMemoryPoolNames();
			for (String s : names) {
				System.out.println(s);
			}
		}
	}
}
